<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>基于WEB的人脸识别考勤系统——控制台</title>
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <link rel="stylesheet" href="css/login.css" media="all">
  </head>
  
  <body style="background: #f2f2f2">
  <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
      <div class="layadmin-user-login-box layadmin-user-login-header">
        <h2>系统控制台登录</h2>
        <p>人脸识别考勤系统的后台管理模块 ——DMLinkong</p>
      </div>
      <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
          <input type="text" name="tid" id="LAY-user-login-username" lay-verify="required" placeholder="教师编号" class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
          <input type="password" name="tpass" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
        </div>
        <div class="layui-form-item" style="margin-bottom: 20px;">
          <a class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;" onclick="forgot()">忘记密码？</a>
        </div>
        <div class="layui-form-item">
          <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit" id="submit">登 入</button>
        </div>
        <div class="layui-trans layui-form-item layadmin-user-login-other">
        	<label>测试用教师ID：2010，密码：123456</label>
        </div>
      </div>
    </div>
    
    <div class="layui-trans layadmin-user-login-footer">
      
      <p>© 2018 <a>DMLinKong</a></p>
      <p>
        <span><a href="index.action" target="_blank">欢迎页</a></span>
        <span><a href="detection.action" target="_blank">检测页</a></span>
        <span><a target="_blank" onclick="contact()">联系我</a></span>
      </p>
    </div>
    
  </div>
  <script src="js/jquery.min.js"></script>
  <script src="layui/layui.js"></script>
  <script>
  layui.use(['layer', 'form'], function(){
  	var layer = layui.layer;
  	var form = layui.form;
  
  	//监听提交
  	form.on('submit(LAY-user-login-submit)', function(d){
    	var data = d.field;
    	$.ajax(
		{
			type:"post",
			url:"login.action",
			dataType:"json",
			data: data,
			success : function(result){
				if(result.code == 1){
					window.location.href = "main.action";
				}
				layer.msg(result.msg);
			}
		});
    	return false;
  	});
  	
  	document.onkeydown =cdk;
	function cdk(){
		if(event.keyCode==13){
			$("#submit").trigger("click");
		}
	}
  });
  
  function forgot(){
  	layer.confirm('请联系网站管理员<br>QQ:543443183<br>tel:18571200938<br>Email:543443183@qq.com', {
		title: '忘记密码'
		,btn: '关闭' //按钮
	});
  }
  
  function contact(){
  	layer.confirm('独木林空<br>QQ:543443183<br>tel:18571200938<br>Email:543443183@qq.com', {
		title: '联系我们'
		,btn: '关闭' //按钮
	});
  }
  </script>

  </body>
</html>
